var gulp = require('gulp');
var browserSync = require('browser-sync').create();
var nodemon = require('gulp-nodemon');

gulp.task('serverDev',function(){
    nodemon({
        script:'./bin/www',
        ignore:['node_modules/'],
        watch:['gulpfile.js','./routes/*.js'],
        env:{
            'NODE_ENV':'development'
        }
    }).on('start',function(){
        browserSync.init({
            proxy:'http://localhost:3000/',
            files:[],
            port:3100,
        },function(){
            console.log("browser refreshed.");
        });
    })
});

gulp.task('dev',['serverDev'],function(){
    console.log('gulp dev');
});